abstract class Creature{
	
	protected int facing;
	protected int maxHP;
	protected int maxMP;
	//protected CreatureClass cls;
	protected int race;
	protected String name;
	protected int hp;
	protected int mp;
	protected int x;
	protected int y;
	
	protected boolean combat;
	
	
	protected int tick = 0;
	protected static final int tickrate = 5;
	protected static final int combattickrate = 15;
	
	
	/*
		Player = @
		Mob = ???
		Corpse = *
	*/
	protected char fm;
	
	protected int dmg;
	protected int armr;
	
	// Type: 0,1,2,3,4,5 for fire, shadow, earth, frost and armor
	protected int firer;
	protected int shadowr;
	protected int earthr;
	protected int frostr;
	protected int holyr;
	
	public Creature(char fm, int x, int y){
		this.fm=fm; this.x=x; this.y=y;
	}
	
	public void takeDMG(int amount, int type){
		switch(type){
			case 0: hp -= (amount -firer); break;
			case 1: hp -= (amount -shadowr); break;
			case 2: hp -= (amount -earthr); break;
			case 3: hp -= (amount -frostr); break;
			case 4: hp -= (amount -holyr); break;
			case 5: hp -= (amount -armr); break;
			case 6: hp -= (amount -firer); break;
			default: hp -= amount; break;
		}
	}
	
	public void regenerate(){
		tick++;
		if(combat && tick >= combattickrate){
			if(hp < maxHP) this.hp += (int)(this.maxHP * 0.01);
			if(mp < maxMP) this.mp += (int)(this.maxMP * 0.05);
			tick = 0;
		}
		else if(!combat && tick >= tickrate){
			if(hp < maxHP) this.hp += (int)(this.maxHP * 0.01);
			if(mp < maxMP) this.mp += (int)(this.maxMP * 0.05);
			tick = 0;
		}
	}
	
	public char getForm(){ return fm; }
	
	public int getX(){ return x; }
	public int getY(){ return y; }
	
	public int getRace(){ return race; }
	
//	public CreatureClass getClass(){ return cls; }
	
	public String getName(){ return name; }
	
	public int getMaxHP(){ return maxHP; }
	public int getMaxMP(){ return maxMP; }
	public int getHP(){ return hp; }
	public int getMP(){ return mp; }
	
	public int getFireR(){ return x; }
	public int getShadowR(){ return y; }
	public int getEarthR(){ return y; }
	public int getFrostR(){ return hp; }
	public int getHolyR(){ return mp; }
	
	
	public void setForm(char f){ fm=f; }
	
	public void setX(int c){ x=c; }
	public void setY(int c){ y=c; }
	
	public void setRace(int race){ this.race = race; }
	
//	public CreatureClass setClass(){ return cls; }
	
	public String setName(){ return name; }
	
	public void setMaxHP(int c){ maxHP=c; }
	public void setMaxMP(int c){ maxMP=c; }
	public void setHP(int c){ hp=c; }
	public void setMP(int c){ mp=c; }
	
	public void setFireR(int c){ x=c; }
	public void setShadowR(int c){ y=c; }
	public void setEarthR(int c){ hp=c; }
	public void setFrostR(int c){ mp=c; }
	public void setHolyR(int c){ mp=c; }
	
	/*
	 * 1: LEFT
	 * 2: RIGHT
	 * 3: UP
	 * 4: DOWN
	 * Doesn't check if space available YET
	 */
	public void move(int dir){
		if(dir == 1){
			this.x = this.x-1;
			facing = 1;
		}
		if(dir == 2){
			this.x = this.x+1;
			facing = 2;
		}
		if(dir == 3){
			this.y = this.y-1;
			facing = 3;
		}
		if(dir == 4){
			this.y = this.y+1;
			facing = 4;
		}
	}

	public void setFacing(int dir){
		facing = dir;
	}
	public int getFacing(){return facing;}
}